<?php 
	include_once("../inc/login_controll.inc.php");
	include_once("../class/config.class.php"); 
	$config = config::getConfig();
	include_once($config->getValue("home_path")."/inc/defines.inc.php");
	
	include_once(HOME_PATH."/class/form.class.php");
	include_once(HOME_PATH."/class/database.class.php");
	include_once(HOME_PATH."/class/user.class.php");
	
	$oForm = new form($config);
	$oDB = new database($config);
	$oForm->setDB($oDB);
	
	$oUser = new user($config);	
	$oUser->setDB($oDB);
	
	if(isset($_GET['f']) && trim($_GET['f'])!==""){
		if($oForm->teacherIsOwner($_SESSION['user_id'], $_GET['f'])){
			$oForm->cloneForm($_GET['f'], $_SESSION['user_id']);
		}
	}
	Header("Location: teacher.php");
?>